<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>违章记录</title>
    <style>
        .data {
            border-collapse:collapse;
        }
        .data td {
            border: 1px solid gray;
        }
        .wide {
            width: 200px;
        }
        .narrow {
            width: 120px;
        }
    </style>
</head>
<body>
    <form action="/search/" method="post">
        {% csrf_token %}
        <input type="text" name="carno">
        <input type="submit" value="查询">
    </form>
    <hr>
    <table class="data">
        <tr>
            <th class="narrow">车牌号</th>
            <th class="narrow">车主</th>
            <th class="wide">违章原因</th>
            <th class="wide">违章日期</th>
            <th class="wide">处罚方式</th>
            <th class="narrow">是否受理</th>
            <th class="narrow">操作</th>
        </tr>
        {% for record in records %}
        <tr>
            <td>{{ record.carno }}</td>
            <td>{{ record.owner }}</td>
            <td>{{ record.reason }}</td>
            <td>{{ record.makedate }}</td>
            <td>{{ record.punish }}</td>
            <td>{{ record.dealt|yesno:'已受理,未受理' }}</td>
            <td>
                <a href="">受理</a>
                <a href="">删除</a>
            </td>
        </tr>
        {% endfor %}
    </table>
</body>
</html>